package com.cf.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cf.dao.ErpQuotationDao;
import com.cf.entity.ErpQuotationEntity;
import com.cf.service.ErpQuotationService;

@Service("erpQuotationService")
public class ErpQuotationServiceImpl implements ErpQuotationService {
	@Autowired
	private ErpQuotationDao erpQuotationDao;

	@Override
	public Integer saveHead(ErpQuotationEntity erpQuotationEntity) {
		try {
			erpQuotationDao.saveHead(erpQuotationEntity);
		} catch (Exception e) {
			return 0;
		}
		return 1;
	}

	@Override
	public String getQuotationNo(String userName) {
		// String quotationNo = erpQuotationDao.getQuotationNo(userName);
		String quotationNo = "JS202009002";
		return quotationNo;
	}

	@Override
	public Integer setQuotationNo(String userName) {
		int i = 0;
		try {
			i = erpQuotationDao.setQuotationNo(userName);
		} catch (Exception e) {
			// TODO: handle exception
			i = -1;

		}
		return i;
	}

}
